Optimal. Leaf size=200 \[ \frac{\sqrt{\cot (c+d x)}}{2 d (a \cot (c+d x)+i a)}-\frac{\left (\frac{3}{8}+\frac{i}{8}\right ) \log \left (\cot (c+d x)-\sqrt{2} \sqrt{\cot (c+d x)}+1\right )}{\sqrt{2} a d}+\frac{\left (\frac{3}{8}+\frac{i}{8}\right ) \log \left (\cot (c+d x)+\sqrt{2} \sqrt{\cot (c+d x)}+1\right )}{\sqrt{2} a d}+\frac{\left (\frac{3}{4}-\frac{i}{4}\right ) \tan ^{-1}\left (1-\sqrt{2} \sqrt{\cot (c+d x)}\right )}{\sqrt{2} a d}-\frac{\left (\frac{3}{4}-\frac{i}{4}\right ) \tan ^{-1}\left (\sqrt{2} \sqrt{\cot (c+d x)}+1\right )}{\sqrt{2} a d} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.204401, antiderivative size = 200, normalized size of antiderivative = 1., number of steps used = 12, number of rules used = 9, integrand size = 26, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.346, Rules used = {3673, 3550, 3534, 1168, 1162, 617, 204, 1165, 628} \[ \frac{\sqrt{\cot (c+d x)}}{2 d (a \cot (c+d x)+i a)}-\frac{\left (\frac{3}{8}+\frac{i}{8}\right ) \log \left (\cot (c+d x)-\sqrt{2} \sqrt{\cot (c+d x)}+1\right )}{\sqrt{2} a d}+\frac{\left (\frac{3}{8}+\frac{i}{8}\right ) \log \left (\cot (c+d x)+\sqrt{2} \sqrt{\cot (c+d x)}+1\right )}{\sqrt{2} a d}+\frac{\left (\frac{3}{4}-\frac{i}{4}\right ) \tan ^{-1}\left (1-\sqrt{2} \sqrt{\cot (c+d x)}\right )}{\sqrt{2} a d}-\frac{\left (\frac{3}{4}-\frac{i}{4}\right ) \tan ^{-1}\left (\sqrt{2} \sqrt{\cot (c+d x)}+1\right )}{\sqrt{2} a d} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 3673
Rule 3550
Rule 3534
Rule 1168
Rule 1162
Rule 617
Rule 204
Rule 1165
Rule 628
Rubi steps
\begin{align*} \int \frac{\sqrt{\cot (c+d x)}}{a+i a \tan (c+d x)} \, dx &=\int \frac{\cot ^{\frac{3}{2}}(c+d x)}{i a+a \cot (c+d x)} \, dx\\ &=\frac{\sqrt{\cot (c+d x)}}{2 d (i a+a \cot (c+d x))}-\frac{\int \frac{\frac{i a}{2}-\frac{3}{2} a \cot (c+d x)}{\sqrt{\cot (c+d x)}} \, dx}{2 a^2}\\ &=\frac{\sqrt{\cot (c+d x)}}{2 d (i a+a \cot (c+d x))}-\frac{\operatorname{Subst}\left (\int \frac{-\frac{i a}{2}+\frac{3 a x^2}{2}}{1+x^4} \, dx,x,\sqrt{\cot (c+d x)}\right )}{a^2 d}\\ &=\frac{\sqrt{\cot (c+d x)}}{2 d (i a+a \cot (c+d x))}--\frac{\left (\frac{3}{4}+\frac{i}{4}\right ) \operatorname{Subst}\left (\int \frac{1-x^2}{1+x^4} \, dx,x,\sqrt{\cot (c+d x)}\right )}{a d}-\frac{\left (\frac{3}{4}-\frac{i}{4}\right ) \operatorname{Subst}\left (\int \frac{1+x^2}{1+x^4} \, dx,x,\sqrt{\cot (c+d x)}\right )}{a d}\\ &=\frac{\sqrt{\cot (c+d x)}}{2 d (i a+a \cot (c+d x))}-\frac{\left (\frac{3}{8}-\frac{i}{8}\right ) \operatorname{Subst}\left (\int \frac{1}{1-\sqrt{2} x+x^2} \, dx,x,\sqrt{\cot (c+d x)}\right )}{a d}-\frac{\left (\frac{3}{8}-\frac{i}{8}\right ) \operatorname{Subst}\left (\int \frac{1}{1+\sqrt{2} x+x^2} \, dx,x,\sqrt{\cot (c+d x)}\right )}{a d}-\frac{\left (\frac{3}{8}+\frac{i}{8}\right ) \operatorname{Subst}\left (\int \frac{\sqrt{2}+2 x}{-1-\sqrt{2} x-x^2} \, dx,x,\sqrt{\cot (c+d x)}\right )}{\sqrt{2} a d}-\frac{\left (\frac{3}{8}+\frac{i}{8}\right ) \operatorname{Subst}\left (\int \frac{\sqrt{2}-2 x}{-1+\sqrt{2} x-x^2} \, dx,x,\sqrt{\cot (c+d x)}\right )}{\sqrt{2} a d}\\ &=\frac{\sqrt{\cot (c+d x)}}{2 d (i a+a \cot (c+d x))}-\frac{\left (\frac{3}{8}+\frac{i}{8}\right ) \log \left (1-\sqrt{2} \sqrt{\cot (c+d x)}+\cot (c+d x)\right )}{\sqrt{2} a d}+\frac{\left (\frac{3}{8}+\frac{i}{8}\right ) \log \left (1+\sqrt{2} \sqrt{\cot (c+d x)}+\cot (c+d x)\right )}{\sqrt{2} a d}--\frac{\left (\frac{3}{4}-\frac{i}{4}\right ) \operatorname{Subst}\left (\int \frac{1}{-1-x^2} \, dx,x,1+\sqrt{2} \sqrt{\cot (c+d x)}\right )}{\sqrt{2} a d}-\frac{\left (\frac{3}{4}-\frac{i}{4}\right ) \operatorname{Subst}\left (\int \frac{1}{-1-x^2} \, dx,x,1-\sqrt{2} \sqrt{\cot (c+d x)}\right )}{\sqrt{2} a d}\\ &=\frac{\left (\frac{3}{4}-\frac{i}{4}\right ) \tan ^{-1}\left (1-\sqrt{2} \sqrt{\cot (c+d x)}\right )}{\sqrt{2} a d}-\frac{\left (\frac{3}{4}-\frac{i}{4}\right ) \tan ^{-1}\left (1+\sqrt{2} \sqrt{\cot (c+d x)}\right )}{\sqrt{2} a d}+\frac{\sqrt{\cot (c+d x)}}{2 d (i a+a \cot (c+d x))}-\frac{\left (\frac{3}{8}+\frac{i}{8}\right ) \log \left (1-\sqrt{2} \sqrt{\cot (c+d x)}+\cot (c+d x)\right )}{\sqrt{2} a d}+\frac{\left (\frac{3}{8}+\frac{i}{8}\right ) \log \left (1+\sqrt{2} \sqrt{\cot (c+d x)}+\cot (c+d x)\right )}{\sqrt{2} a d}\\ \end{align*}
Mathematica [A] time = 0.923598, size = 174, normalized size = 0.87 \[ \frac{\left (\frac{1}{8}+\frac{i}{8}\right ) \sqrt{\sin (2 (c+d x))} \sqrt{\cot (c+d x)} \left (\frac{2-2 i}{\sqrt{\sin (2 (c+d x))}}+(1+2 i) \sec (c+d x) \log \left (\sin (c+d x)+\sqrt{\sin (2 (c+d x))}+\cos (c+d x)\right )+(2-i) \csc (c+d x) \log \left (\sin (c+d x)+\sqrt{\sin (2 (c+d x))}+\cos (c+d x)\right )-(1-2 i) \sin ^{-1}(\cos (c+d x)-\sin (c+d x)) (\csc (c+d x)+i \sec (c+d x))\right )}{a d (\cot (c+d x)+i)} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [C] time = 0.347, size = 711, normalized size = 3.6 \begin{align*} \text{result too large to display} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F(-2)] time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: RuntimeError} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] time = 1.36098, size = 1297, normalized size = 6.48 \begin{align*} \frac{{\left (a d \sqrt{-\frac{i}{4 \, a^{2} d^{2}}} e^{\left (2 i \, d x + 2 i \, c\right )} \log \left ({\left ({\left (4 i \, a d e^{\left (2 i \, d x + 2 i \, c\right )} - 4 i \, a d\right )} \sqrt{\frac{i \, e^{\left (2 i \, d x + 2 i \, c\right )} + i}{e^{\left (2 i \, d x + 2 i \, c\right )} - 1}} \sqrt{-\frac{i}{4 \, a^{2} d^{2}}} + 2 i \, e^{\left (2 i \, d x + 2 i \, c\right )}\right )} e^{\left (-2 i \, d x - 2 i \, c\right )}\right ) - a d \sqrt{-\frac{i}{4 \, a^{2} d^{2}}} e^{\left (2 i \, d x + 2 i \, c\right )} \log \left ({\left ({\left (-4 i \, a d e^{\left (2 i \, d x + 2 i \, c\right )} + 4 i \, a d\right )} \sqrt{\frac{i \, e^{\left (2 i \, d x + 2 i \, c\right )} + i}{e^{\left (2 i \, d x + 2 i \, c\right )} - 1}} \sqrt{-\frac{i}{4 \, a^{2} d^{2}}} + 2 i \, e^{\left (2 i \, d x + 2 i \, c\right )}\right )} e^{\left (-2 i \, d x - 2 i \, c\right )}\right ) - a d \sqrt{\frac{i}{a^{2} d^{2}}} e^{\left (2 i \, d x + 2 i \, c\right )} \log \left (-\frac{{\left ({\left (a d e^{\left (2 i \, d x + 2 i \, c\right )} - a d\right )} \sqrt{\frac{i \, e^{\left (2 i \, d x + 2 i \, c\right )} + i}{e^{\left (2 i \, d x + 2 i \, c\right )} - 1}} \sqrt{\frac{i}{a^{2} d^{2}}} + 1\right )} e^{\left (-2 i \, d x - 2 i \, c\right )}}{a d}\right ) + a d \sqrt{\frac{i}{a^{2} d^{2}}} e^{\left (2 i \, d x + 2 i \, c\right )} \log \left (\frac{{\left ({\left (a d e^{\left (2 i \, d x + 2 i \, c\right )} - a d\right )} \sqrt{\frac{i \, e^{\left (2 i \, d x + 2 i \, c\right )} + i}{e^{\left (2 i \, d x + 2 i \, c\right )} - 1}} \sqrt{\frac{i}{a^{2} d^{2}}} - 1\right )} e^{\left (-2 i \, d x - 2 i \, c\right )}}{a d}\right ) + \sqrt{\frac{i \, e^{\left (2 i \, d x + 2 i \, c\right )} + i}{e^{\left (2 i \, d x + 2 i \, c\right )} - 1}}{\left (-i \, e^{\left (2 i \, d x + 2 i \, c\right )} + i\right )}\right )} e^{\left (-2 i \, d x - 2 i \, c\right )}}{4 \, a d} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F(-2)] time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: AttributeError} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [F] time = 0., size = 0, normalized size = 0. \begin{align*} \int \frac{\sqrt{\cot \left (d x + c\right )}}{i \, a \tan \left (d x + c\right ) + a}\,{d x} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]